æòÅⁿâoâiü[

File Object


    File("path")

Description

    The File object contains methods and attributes common to File objects. A Folder object corresponds to a directory or folder.

    Also included in this object are all attributes and methods within the FileSystem object, as those apply to Files as well as Folders.

Attributes

    creator

    see File creator Attribute

    The Macintosh file creator as a four-character string.

    encoding

    see File encoding Attribute

    Gets or sets the encoding for subsequent read/write operations.

    eof

    see File eof Attribute

    Has the value true if a read attempt caused the current position to be behind the end of the file.

    hidden

    see File hidden Attribute

    Set to true if the file is invisible.

    length

    see File length Attribute

    The size of the file in bytes.

    lineFeed

    see File lineFeed Attribute

    The way line feed characters are written.

    readonly

    see File readonly Attribute

    When set, prevents the file from being altered or deleted.

    type

    see File type Attribute

    The Macintosh file type as a four-character string.

(Attributes inherited from FileSystem Object)

    absoluteURI

    see FileSystem absoluteURI Attribute

    The full path name for the object in URI notation.

    alias

    see FileSystem alias Attribute

    Returns true if the object refers to a file system alias.

    created

    see FileSystem created Attribute

    The creation date of the object.

    error

    see FileSystem error Attribute

    Contains a message describing the last file system error.

    exists

    see FileSystem exists Attribute

    Returns true if the path name of this object refers to an actually existing file or folder.

    fsName

    see FileSystem fsName Attribute

    The file-system specific name of the object as a full path name.

    modified

    see FileSystem modified Attribute

    The date of the object's last modification.

    name

    see FileSystem name Attribute

    The name of the object without the path specification.

    parent

    see FileSystem parent Attribute

    The folder object containing this object.

    path

    see FileSystem path Attribute

    The path portion of the absolute URI.

    relativeURI

    see FileSystem relativeURI Attribute

    The path name for the object in URI notation, relative to the current folder.

Methods

    close()

    see File close() Method

    Closes the open file.

    copy()

    see File copy() Method

    Copies the file to the given location.

    open()

    see File open() Method

    Open the file for subsequent read/write operations.

    read()

    see File read() Method

    Read the contents of the file from the current position on.

    readch()

    see File readch() Method

    Read one single text character.

    readln()

    see File readln() Method

    Read one line of text.

    seek()

    see File seek() Method

    Seek to a certain position in the file.

    tell()

    see File tell() Method

    Returns the current position in the file as a an offset in bytes.

    write()

    see File write() Method

    Write the given string to the file.

    writeln()

    see File writeln() Method

    Write the given string to the file and append a line feed sequence.

(Methods inherited from FileSystem Object)

    getRelativeURI()

    see FileSystem getRelativeURI() Method

    Calculate and return the relative URI, given a base path, in URI notation.

    remove()

    see FileSystem remove() Method

    Delete the file or folder that this object represents.

    rename()

    see FileSystem rename() Method

    Rename the object to the new name.

    resolve()

    see FileSystem resolve() Method

    Attempt to resolve the file system alias that this object points to.